package com.etone.smartAudit.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: sovy
 * @date: 2020/8/19
 * @description:
 */
public class ArraysExtendUtil {
    /**
     * 合并数组
     * 由于java.util.Arrays.asList(...)返回的是内部类（ArrayList）,无法用List.add() listAddAll() 方法
     *
     * @param lists
     * @param <T>
     * @return
     */
    public static <T> List<T> mergerArraysList(List<T>... lists) {
        if (lists == null || lists.length <= 0) {
            return null;
        }
        List<T> result = new ArrayList<>();
        for (List<T> list : lists) {
            if (list != null) {
                result.addAll(new ArrayList<>(list));
            }

        }
        return result;
    }
}
